<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>if-for的练习</title>
</head>

<body>
    <p>在页面输出一个图案：</p>
    <script>
        for (var i = 0; i < 10; i++) {
            if (i % 2 == 0) {
                for (var j = 0; j < 10; j++) {
                    document.write('<span style="color:red">您</span>', '<span style="color:blue">好</span>');
                }
            } else {
                for (var j = 0; j < 10; j++) {
                    document.write('<span style="color:blue">您</span>', '<span style="color:red">好</span>');
                }
            }
            document.write("<br>");
        }
    </script>
</body>

</html>